package com.chartboost.sdk.impl;

import android.view.View;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import com.chartboost.sdk.Chartboost;
import com.chartboost.sdk.Libraries.CBOrientation.Difference;

public class n
{
  public static void a(b paramb, a parama)
  {
    a(paramb, parama, null);
  }

  public static void a(b paramb, a parama, a parama1)
  {
    b(paramb, parama, parama1, Boolean.valueOf(true));
  }

  public static void b(b paramb, a parama, a parama1)
  {
    c(paramb, parama, parama1, Boolean.valueOf(false));
  }

  private static void b(final b paramb, final a parama, final a parama1, final Boolean paramBoolean)
  {
    if ((parama == null) || (parama.h == null));
    View localView;
    ViewTreeObserver localViewTreeObserver;
    do
    {
      do
      {
        return;
        localView = parama.h.c();
      }
      while (localView == null);
      localViewTreeObserver = localView.getViewTreeObserver();
    }
    while (!localViewTreeObserver.isAlive());
    localViewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
    {
      public void onGlobalLayout()
      {
        n.this.getViewTreeObserver().removeGlobalOnLayoutListener(this);
        n.a(paramb, parama, parama1, paramBoolean);
      }
    });
  }

  private static void c(b paramb, final a parama, a parama1, Boolean paramBoolean)
  {
    AnimationSet localAnimationSet = new AnimationSet(true);
    localAnimationSet.addAnimation(new AlphaAnimation(1.0F, 1.0F));
    if ((parama == null) || (parama.h == null));
    View localView;
    do
    {
      return;
      localView = parama.h.c();
    }
    while (localView == null);
    float f1 = localView.getWidth();
    float f2 = localView.getHeight();
    float f3 = (1.0F - 0.4F) / 2.0F;
    CBOrientation.Difference localDifference = Chartboost.sharedChartboost().getForcedOrientationDifference();
    switch (b()[paramb.ordinal()])
    {
    default:
    case 4:
    case 2:
    case 5:
    case 6:
    case 3:
    }
    while (true)
    {
      localAnimationSet.setAnimationListener(new Animation.AnimationListener()
      {
        public void onAnimationEnd(Animation paramAnonymousAnimation)
        {
          if (n.this != null)
            n.this.a(parama);
        }

        public void onAnimationRepeat(Animation paramAnonymousAnimation)
        {
        }

        public void onAnimationStart(Animation paramAnonymousAnimation)
        {
        }
      });
      localView.startAnimation(localAnimationSet);
      return;
      p localp2;
      label209: ScaleAnimation localScaleAnimation6;
      label252: TranslateAnimation localTranslateAnimation4;
      switch (a()[localDifference.ordinal()])
      {
      default:
        if (paramBoolean.booleanValue())
        {
          localp2 = new p(-60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, false);
          localp2.setDuration(600L);
          localp2.setFillAfter(true);
          localAnimationSet.addAnimation(localp2);
          if (!paramBoolean.booleanValue())
            break label553;
          localScaleAnimation6 = new ScaleAnimation(0.4F, 1.0F, 0.4F, 1.0F);
          localScaleAnimation6.setDuration(600L);
          localScaleAnimation6.setFillAfter(true);
          localAnimationSet.addAnimation(localScaleAnimation6);
          switch (a()[localDifference.ordinal()])
          {
          default:
            if (paramBoolean.booleanValue())
              localTranslateAnimation4 = new TranslateAnimation(f1 * f3, 0.0F, 0.4F * -f2, 0.0F);
            break;
          case 2:
          case 3:
          case 4:
          }
        }
        break;
      case 2:
      case 3:
      case 4:
      }
      while (true)
      {
        localTranslateAnimation4.setDuration(600L);
        localTranslateAnimation4.setFillAfter(true);
        localAnimationSet.addAnimation(localTranslateAnimation4);
        break;
        if (paramBoolean.booleanValue())
        {
          localp2 = new p(-60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, true);
          break label209;
        }
        localp2 = new p(0.0F, 60.0F, f1 / 2.0F, f2 / 2.0F, true);
        break label209;
        if (paramBoolean.booleanValue())
        {
          localp2 = new p(60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, false);
          break label209;
        }
        localp2 = new p(0.0F, -60.0F, f1 / 2.0F, f2 / 2.0F, false);
        break label209;
        if (paramBoolean.booleanValue())
        {
          localp2 = new p(60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, true);
          break label209;
        }
        localp2 = new p(0.0F, -60.0F, f1 / 2.0F, f2 / 2.0F, true);
        break label209;
        localp2 = new p(0.0F, 60.0F, f1 / 2.0F, f2 / 2.0F, false);
        break label209;
        label553: localScaleAnimation6 = new ScaleAnimation(1.0F, 0.4F, 1.0F, 0.4F);
        break label252;
        if (paramBoolean.booleanValue())
        {
          localTranslateAnimation4 = new TranslateAnimation(f1, 0.0F, f2 * f3, 0.0F);
        }
        else
        {
          localTranslateAnimation4 = new TranslateAnimation(0.0F, 0.4F * -f1, 0.0F, f2 * f3);
          continue;
          if (paramBoolean.booleanValue())
          {
            localTranslateAnimation4 = new TranslateAnimation(f1 * f3, 0.0F, f2, 0.0F);
          }
          else
          {
            localTranslateAnimation4 = new TranslateAnimation(0.0F, f1 * f3, 0.0F, 0.4F * -f2);
            continue;
            if (paramBoolean.booleanValue())
            {
              localTranslateAnimation4 = new TranslateAnimation(0.4F * -f1, 0.0F, f2 * f3, 0.0F);
            }
            else
            {
              localTranslateAnimation4 = new TranslateAnimation(0.0F, f1, 0.0F, f2 * f3);
              continue;
              localTranslateAnimation4 = new TranslateAnimation(0.0F, f1 * f3, 0.0F, f2);
            }
          }
        }
      }
      p localp1;
      label817: ScaleAnimation localScaleAnimation5;
      label860: TranslateAnimation localTranslateAnimation3;
      switch (a()[localDifference.ordinal()])
      {
      default:
        if (paramBoolean.booleanValue())
        {
          localp1 = new p(-60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, true);
          localp1.setDuration(600L);
          localp1.setFillAfter(true);
          localAnimationSet.addAnimation(localp1);
          if (!paramBoolean.booleanValue())
            break label1161;
          localScaleAnimation5 = new ScaleAnimation(0.4F, 1.0F, 0.4F, 1.0F);
          localScaleAnimation5.setDuration(600L);
          localScaleAnimation5.setFillAfter(true);
          localAnimationSet.addAnimation(localScaleAnimation5);
          switch (a()[localDifference.ordinal()])
          {
          default:
            if (paramBoolean.booleanValue())
              localTranslateAnimation3 = new TranslateAnimation(0.4F * -f1, 0.0F, f2 * f3, 0.0F);
            break;
          case 2:
          case 3:
          case 4:
          }
        }
        break;
      case 2:
      case 3:
      case 4:
      }
      while (true)
      {
        localTranslateAnimation3.setDuration(600L);
        localTranslateAnimation3.setFillAfter(true);
        localAnimationSet.addAnimation(localTranslateAnimation3);
        break;
        if (paramBoolean.booleanValue())
        {
          localp1 = new p(60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, false);
          break label817;
        }
        localp1 = new p(0.0F, -60.0F, f1 / 2.0F, f2 / 2.0F, false);
        break label817;
        if (paramBoolean.booleanValue())
        {
          localp1 = new p(60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, true);
          break label817;
        }
        localp1 = new p(0.0F, -60.0F, f1 / 2.0F, f2 / 2.0F, true);
        break label817;
        if (paramBoolean.booleanValue())
        {
          localp1 = new p(-60.0F, 0.0F, f1 / 2.0F, f2 / 2.0F, false);
          break label817;
        }
        localp1 = new p(0.0F, 60.0F, f1 / 2.0F, f2 / 2.0F, false);
        break label817;
        localp1 = new p(0.0F, 60.0F, f1 / 2.0F, f2 / 2.0F, true);
        break label817;
        label1161: localScaleAnimation5 = new ScaleAnimation(1.0F, 0.4F, 1.0F, 0.4F);
        break label860;
        if (paramBoolean.booleanValue())
        {
          localTranslateAnimation3 = new TranslateAnimation(f1 * f3, 0.0F, 0.4F * -f2, 0.0F);
        }
        else
        {
          localTranslateAnimation3 = new TranslateAnimation(0.0F, f1 * f3, 0.0F, f2);
          continue;
          if (paramBoolean.booleanValue())
          {
            localTranslateAnimation3 = new TranslateAnimation(f1, 0.0F, f2 * f3, 0.0F);
          }
          else
          {
            localTranslateAnimation3 = new TranslateAnimation(0.0F, 0.4F * -f1, 0.0F, f2 * f3);
            continue;
            if (paramBoolean.booleanValue())
            {
              localTranslateAnimation3 = new TranslateAnimation(f1 * f3, 0.0F, f2, 0.0F);
            }
            else
            {
              localTranslateAnimation3 = new TranslateAnimation(0.0F, f1 * f3, 0.0F, 0.4F * -f2);
              continue;
              localTranslateAnimation3 = new TranslateAnimation(0.0F, f1, 0.0F, f2 * f3);
            }
          }
        }
      }
      float f13;
      float f11;
      float f12;
      switch (a()[localDifference.ordinal()])
      {
      default:
        f2 = 0.0F;
        f13 = 0.0F;
        f11 = 0.0F;
        f12 = 0.0F;
        TranslateAnimation localTranslateAnimation2 = new TranslateAnimation(f12, f11, f13, f2);
        localTranslateAnimation2.setDuration(600L);
        localTranslateAnimation2.setFillAfter(true);
        localAnimationSet.addAnimation(localTranslateAnimation2);
        break;
      case 1:
        if (paramBoolean.booleanValue());
        for (f13 = f2; ; f13 = 0.0F)
        {
          if (paramBoolean.booleanValue())
            f2 = 0.0F;
          f11 = 0.0F;
          f12 = 0.0F;
          break;
        }
      case 2:
        float f15;
        if (paramBoolean.booleanValue())
        {
          f15 = -f1;
          if (!paramBoolean.booleanValue())
            break label1530;
        }
        for (f11 = 0.0F; ; f11 = -f1)
        {
          f12 = f15;
          f13 = 0.0F;
          f2 = 0.0F;
          break;
          f15 = 0.0F;
          break label1501;
        }
      case 3:
        if (paramBoolean.booleanValue())
        {
          f13 = -f2;
          if (!paramBoolean.booleanValue())
            break label1579;
        }
        for (float f14 = 0.0F; ; f14 = -f2)
        {
          f2 = f14;
          f11 = 0.0F;
          f12 = 0.0F;
          break;
          f13 = 0.0F;
          break label1550;
        }
      case 4:
        label1501: label1530: if (paramBoolean.booleanValue());
        label1550: label1579: for (float f10 = f1; ; f10 = 0.0F)
        {
          if (paramBoolean.booleanValue())
            f1 = 0.0F;
          f11 = f1;
          f12 = f10;
          f13 = 0.0F;
          f2 = 0.0F;
          break;
        }
        float f8;
        float f7;
        float f6;
        switch (a()[localDifference.ordinal()])
        {
        default:
          f8 = 0.0F;
          f7 = 0.0F;
          f1 = 0.0F;
          f6 = 0.0F;
          TranslateAnimation localTranslateAnimation1 = new TranslateAnimation(f6, f1, f7, f8);
          localTranslateAnimation1.setDuration(600L);
          localTranslateAnimation1.setFillAfter(true);
          localAnimationSet.addAnimation(localTranslateAnimation1);
          break;
        case 1:
          if (paramBoolean.booleanValue())
          {
            f7 = -f2;
            if (!paramBoolean.booleanValue())
              break label1762;
          }
          for (f8 = 0.0F; ; f8 = -f2)
          {
            f6 = 0.0F;
            f1 = 0.0F;
            break;
            f7 = 0.0F;
            break label1737;
          }
        case 2:
          if (paramBoolean.booleanValue());
          for (float f9 = f1; ; f9 = 0.0F)
          {
            if (paramBoolean.booleanValue())
              f1 = 0.0F;
            f6 = f9;
            f7 = 0.0F;
            f8 = 0.0F;
            break;
          }
        case 3:
          if (paramBoolean.booleanValue());
          for (f7 = f2; ; f7 = 0.0F)
          {
            if (paramBoolean.booleanValue())
              f2 = 0.0F;
            f8 = f2;
            f6 = 0.0F;
            f1 = 0.0F;
            break;
          }
        case 4:
          label1737: label1762: float f4;
          if (paramBoolean.booleanValue())
          {
            f4 = -f1;
            label1862: if (!paramBoolean.booleanValue())
              break label1895;
          }
          label1895: for (float f5 = 0.0F; ; f5 = -f1)
          {
            f1 = f5;
            f6 = f4;
            f7 = 0.0F;
            f8 = 0.0F;
            break;
            f4 = 0.0F;
            break label1862;
          }
          if (paramBoolean.booleanValue())
          {
            ScaleAnimation localScaleAnimation1 = new ScaleAnimation(0.6F, 1.1F, 0.6F, 1.1F, 1, 0.5F, 1, 0.5F);
            localScaleAnimation1.setDuration(Math.round(0.6F * (float)600L));
            localScaleAnimation1.setStartOffset(0L);
            localScaleAnimation1.setFillAfter(true);
            localAnimationSet.addAnimation(localScaleAnimation1);
            ScaleAnimation localScaleAnimation2 = new ScaleAnimation(1.0F, 0.8181818F, 1.0F, 0.8181818F, 1, 0.5F, 1, 0.5F);
            localScaleAnimation2.setDuration(Math.round(0.2F * (float)600L));
            localScaleAnimation2.setStartOffset(Math.round(0.6F * (float)600L));
            localScaleAnimation2.setFillAfter(true);
            localAnimationSet.addAnimation(localScaleAnimation2);
            ScaleAnimation localScaleAnimation3 = new ScaleAnimation(1.0F, 1.111111F, 1.0F, 1.111111F, 1, 0.5F, 1, 0.5F);
            localScaleAnimation3.setDuration(Math.round(0.09999996F * (float)600L));
            localScaleAnimation3.setStartOffset(Math.round(0.8F * (float)600L));
            localScaleAnimation3.setFillAfter(true);
            localAnimationSet.addAnimation(localScaleAnimation3);
          }
          else
          {
            ScaleAnimation localScaleAnimation4 = new ScaleAnimation(1.0F, 0.0F, 1.0F, 0.0F, 1, 0.5F, 1, 0.5F);
            localScaleAnimation4.setDuration(600L);
            localScaleAnimation4.setStartOffset(0L);
            localScaleAnimation4.setFillAfter(true);
            localAnimationSet.addAnimation(localScaleAnimation4);
          }
          break;
        }
        break;
      }
    }
  }

  public static abstract interface a
  {
    public abstract void a(a parama);
  }

  public static enum b
  {
    static
    {
      b[] arrayOfb = new b[6];
      arrayOfb[0] = a;
      arrayOfb[1] = b;
      arrayOfb[2] = c;
      arrayOfb[3] = d;
      arrayOfb[4] = e;
      arrayOfb[5] = f;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.chartboost.sdk.impl.n
 * JD-Core Version:    0.6.2
 */